'use strict';

const Controller = require('egg').Controller;

class DetailController extends Controller {
  async index() {
    const { ctx } = this;
    const { id } = ctx.query;
    const res = await ctx.service.movies.getMovieDetailOrSearch({id:id});
    if (res.length) {
      ctx.body = {
        status: 200,
        res,
      };
    } else {
      ctx.body = {
        status: 400,
        msg: '输入的参数错误',
      };
    }
  }
}

module.exports = DetailController;
